// 本地声明即可，无需从 useScrollList 中导出
interface OrderItem {
    id: string;
    name: string;
    impactScore: string;
    time: string;
}

// 实时等级变化
export function useCustomerLevelForm() {
    // 模拟接口
    async function fetchOrderPage(page: number, size: number): Promise<OrderItem[]> {
        return new Promise(resolve =>
            setTimeout(() => {
                const data = Array.from({ length: size }, (_, i) => ({
                    id: `${page}-${i}`,
                    name: `远方的****生活`,
                    impactScore: `800 贡献值`,
                    time: new Date().toLocaleTimeString(),
                }));
                resolve(page >= 5 ? [] : data);
            }, 600)
        );
    }
    // 定时追加的数据
    function realtimeFactory(): OrderItem {
        return {
            id: `live-${Date.now()}`,
            name: "远方的****生活",
            impactScore: `800 贡献值`,
            time: new Date().toLocaleTimeString(),
        };
    }
    const columns = [
        { key: "name", title: "商品名称", width: "110px" },
        { key: "impactScore", title: "商品描述", width: "calc(100% - 226px)" },
        { key: "time", title: "添加时间", width: "116px" },
    ];

    return { realtimeFactory, fetchOrderPage, columns };
}